<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>上传部署文件</title>
    <link rel="stylesheet" href="/static/build/layui.css" th:href="@{/static/layui/css/layui.css}" media="all">
</head>
<body>

<button type="button" class="layui-btn" id="delopyFile">
    <i class="layui-icon">&#xe67c;</i>上传文件
</button>

<script src="/static/build/layui.js" th:src="@{/static/layui/layui.js}"></script>
<script>
    layui.use('upload', function(){
        var upload = layui.upload;

        //执行实例
        var uploadInst = upload.render({
            elem: '#delopyFile' //绑定元素
            ,url: '/deploy/deployByZip' //上传接口
            ,accept: 'file'
            ,done: function(res){
                //上传完毕回调
                if(res.code == 0){
                    layer.msg(res.msg);
                }else{
                    layer.msg(res.msg);
                }
            }
            ,error: function(){
                //请求异常回调
            }
        });
    });
</script>
</body>
</html>